/**
 * Name        : Test
 * Version     : 
 * Vendor      : 
 * Description : 
 */

#include "Beholder.h"

using namespace Osp::App;
using namespace Osp::Base;
using namespace Osp::System;
using namespace Osp::Ui;
using namespace Osp::Ui::Controls;
using namespace Osp::Io;
using namespace Osp::Net::Http;

Beholder::Beholder() {

}

Beholder::~Beholder() {

}

Application*
Beholder::CreateInstance(void)
{
	// Create the instance through the constructor.
	return new Beholder();
}

bool
Beholder::OnAppInitializing(AppRegistry& appRegistry) {

	AppLog("Application Initializing");

	// Add the form to the frame
	Frame *pFrame = GetAppFrame()->GetFrame();
	pFrame->SetBackgroundColor(Osp::Graphics::Color::COLOR_BLACK);

	String* hostAddress = new String(L"http://192.168.0.186:8080");
	//String* hostAddress = new String(L"http://192.168.110.228:8080");

	shooter = new Shooter();
	sender = new ShotHttpSender(shooter, hostAddress);

	AppLog("Test started");
	return true;

}

bool
Beholder::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination) {
	AppLog("Terminating");
	return true;
}

void
Beholder::OnForeground(void){
	AppLog("OnForeground");
}

void
Beholder::OnBackground(void) {
	AppLog("OnBackground");
}

void
Beholder::OnLowMemory(void) {
	AppLog("OnLowMemory");
}

void
Beholder::OnBatteryLevelChanged(BatteryLevel batteryLevel) {
	AppLog("OnBatteryLevelChanged");
}
